package com.sky.controller.user;

import com.sky.constant.StatusConstant;
import com.sky.result.Result;
import com.sky.service.ShopingService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController("userShopController")
@RequestMapping("/user/shop")
@Slf4j
public class ShopController {
    @Autowired
    ShopingService service;

    @GetMapping("/status")
    public Result getStatus() {
        Integer status = service.getStatus();
        log.info(String.valueOf(status));
        log.info("店铺状态为" + new String(status == StatusConstant.ENABLE ? "营业中" : "打烊了"));
        return Result.success(status);
    }
}
